package HuaWeiOd.AA;

import java.util.Scanner;

/**
 * @author caihe
 * @date 2023/4/13 14:01
 */
public class 分奖金 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int sum = 0;
        for (int i = 0; i < n; i++) {
            boolean flag = true;
            for (int j = i + 1; j < n && i < j; j++) {
                if (arr[j] > arr[i]) {
                    int num = (j - i) * (arr[j] - arr[i]);
                    sum += num;
                    System.out.println(num);
                    flag = false;
                    break;
                }
            }
            if (flag) {
                sum += arr[i];
                System.out.println(arr[i]);
            }
        }
       
    }
}
